//
//  ViewController.m
//  OMG
//
//  Created by Burn on 2019/7/5.
//  Copyright © 2019 menksoft. All rights reserved.
//

#import "ViewController.h"
#import "RemoteView.h"
#import "Macro.h"
#import "MenkSlider.h"

@interface ViewController ()

@property(strong,nonatomic) NSTimer *timer;

@end

@implementation ViewController


- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
}

- (void)viewDidDisappear:(BOOL)animated{
    [super viewDidDisappear:animated];
    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
//    http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4
//    http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
    CGRect frame = CGRectMake(0, SafeAreaLiuHiaHeight, SCREEN_WIDTH, SCREEN_WIDTH * 9 / 16);
    RemoteView *rview = [[RemoteView alloc]initWith:[NSURL URLWithString:@"http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4"] cachePolicy:NO frame:frame];
    [self.view addSubview:rview];

    self.playerVC = YES;
    self.playerView = rview;
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(fullScreenClick:) name:FULLSCREENCLICK object:nil];
    self.view.backgroundColor = [UIColor colorWithRed:arc4random_uniform(255) / 255.0 green:arc4random_uniform(255) / 255.0 blue:arc4random_uniform(255) / 255.0 alpha:1];
}


- (void)fullScreenClick:(NSNotification *)notification{
    [self fullScreenAction];
}

- (void)back{
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)dealloc{
    DLOG(@"ViewController.h - dealloc");
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}

- (BOOL)mk_navigationHidden:(MenkNavnigationBar *)navigationBar{
    return YES;
}

@end
